<script language="javascript" type="text/javascript">
function formvalidacion()
{
	var form = document.contactos;
	if(form.nombre.value == "")
	{
            alert( "Ingresar Nombre:" );
            return false;
	}
	else if(form.apellidos.value == "")
	{
            //document.title = "Gestionar Contacto";
            alert( "Ingresar Apellidos:");
            return false;
	}else if(form.email.value == "")
	{
            alert( "Ingresar E-mail:" );
            return false;
	}
}
</script>
<div align="justify" style="font-size:12px; color:#222222; padding: 5px 150px 30px 150px;">
        
    <div style="border-bottom: 1px solid #DDD; padding: 8px 0px 0px 0px;">
        <h2 style="font-size:12px; color:#222222;">{$titulo}</h2>
    </div>
    
   <div>
   <form action="contactos.php?do={$dohacer}" method="post" enctype="multipart/form-data" name="contactos" id="contactos">
       <table align="center" border="0" cellspacing="0" cellpadding="0" width="70%" class="small">
           <tbody>
            <tr>
                <td colspan="2" style="padding:10px 0px 10px 0px">
                   <div align="center">
                    <input title="{$txtboton} [Alt+S]" accesskey="S" class="save" type="submit" name="button" value="{$txtboton}" style="width:100px" onclick="return( formvalidacion());">
                    <input title="Cancelar [Alt+X]" accesskey="X" class="cancel" type="button" name="button" value="Cancelar" style="width:100px" onclick="window.history.back()">
                   </div>
                </td>
            </tr>

            <tr>
                <td colspan="2" class="detailedViewHeader">
                    <b>Datos Personales</b>
                </td>
            </tr>

            <!-- Added this file to display the fields in Create Entity page based on ui types  -->
            <tr style="height:25px">

                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>C&oacute;digo
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input readonly="" name="codigo" style="border:1px solid #bababa; width:40%;" type="text" value="{$con_cod}">
                </td>

            </tr>

            <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"> * </font>Nombre
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="nombre" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$nombre|utf8_encode}">
                </td>

            </tr>
    
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"> * </font>Apellidos
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="apellidos" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$apellidos|utf8_encode}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red">  </font>Direcci&oacute;n
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="direccion" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$direccion|utf8_encode}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red">  </font>Fecha nacimiento
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="fechanac" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$fechanac}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red">  </font>Celular
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="celular" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$celular}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red">  </font>Tel&eacute;fono
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="telefono" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$telefono}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"> * </font>E-mail
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="email" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$email}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Facebook (username)
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <img class="redsocial_icon" title="Facebook" border="0" alt="Facebook" align="left" src="img/fb.jpg" width="14" height="14">
                    <input type="text" name="userfacebook" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:35%;" value="{$facebook}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Twitter (username)
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <img class="redsocial_icon" title="Twitter" border="0" alt="Facebook" align="left" src="img/twt.png" width="14" height="14">
                    <input type="text" name="usertwitter" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:35%;" value="{$twitter}">
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Recibe E-mail
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <label>   
                    {if $recibemail == ""}
                        <input type="radio" name="recibemail"  value="1" checked="checked"/>
                    {elseif $recibemail eq "1"}
                        <input type="radio" name="recibemail"  value="1" checked="checked"/>
                    {elseif $recibemail eq "0"}
                        <input type="radio" name="recibemail"  value="1" />
                    {/if}
                    Si</label>

                    <label>
                    {if $recibemail == ""}
                        <input type="radio" name="recibemail"  value="0" />
                    {elseif $recibemail eq "1"}
                        <input type="radio" name="recibemail"  value="0" />
                    {elseif $recibemail eq "0"}
                        <input type="radio" name="recibemail"  value="0" checked="checked" />
                    {/if}
                    No</label>
                </td>
           </tr>

           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Empresa
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                <select name="lstempresas" tabindex="" class="small" style="width: 25%;">
                {if $empresaactual eq NULL}
                    <option selected="selected" value="NULL">-----</option>
                {/if}
                {section name=i loop=$listaempresas}
                {if $empresaactual eq $listaempresas[i].emp_cod}
                    <option value="{$listaempresas[i].emp_cod}" selected="selected">{$listaempresas[i].emp_nombre|utf8_encode}</option>
                {else}
                    <option value="{$listaempresas[i].emp_cod}">{$listaempresas[i].emp_nombre|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </td>
           </tr>
           <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red">  </font>Cargo
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input type="text" name="cargo" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:40%;" value="{$cargo}">
                </td>
           </tr>
           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Origen de Contacto
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                <select name="lstorigencontactos" tabindex="" class="small" style="width: 25%;">
                {section name=i loop=$origencontactos}
                {if $origenactual eq $origencontactos[i].ori_cod}
                    <option value="{$origencontactos[i].ori_cod}" selected="selected">{$origencontactos[i].ori_descripcion|utf8_encode}</option>
                {else}
                    <option value="{$origencontactos[i].ori_cod}">{$origencontactos[i].ori_descripcion|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </td>
           </tr>

           <tr style="height:20px">
               <td>&nbsp;</td>
           </tr>

           <tr>	
                <td colspan="2" class="detailedViewHeader">
                    <b>Información Adicional</b>
                </td>
           </tr>
            
           <tr style="height:25px">

                <td width="20%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Descripci&oacute;n
                </td>
		
                <td colspan="2">
                    <textarea class="detailedViewTextBox" tabindex="" onfocus="this.className='detailedViewTextBoxOn'" name="descripcion" onblur="this.className='detailedViewTextBox'" cols="90" rows="8">{$descripcion|utf8_encode}</textarea>
		</td>
            </tr>
                           
            <tr tyle="height:25px"><td>&nbsp;</td>
            </tr>
           
            <tr>
																				<td colspan="4" class="detailedViewHeader">
            <b>Informaci&oacute;n de Foto del Contacto:</b>
																				</td>
            </tr>

            <tr style="height:25px">

                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Imagen del Contacto
                </td>
                <td colspan="2" width="70%" align="left" class="dvtCellInfo">
                    {if $imagen eq NULL}
                        <input type="file" name="userfile">
                    {else}
                        <div align="center" style="padding: 5px;"><img src="{$imagen}"  title="{$nombre|utf8_encode} {$apellidos|utf8_encode}" border="0" alt="{$nombre|utf8_encode} {$apellidos|utf8_encode}" width="120px" height="120px"></div>
                        <input type="hidden" name="userfile" value="{$imagen}">
                    {/if}
                </td>
                
            </tr>

            <tr>
		<td colspan="2" style="padding:10px 0px 10px 0px">
		<div align="center">
                    <input title="{$txtboton} [Alt+S]" accesskey="S" class="save" type="submit" name="button" value="{$txtboton}" style="width:100px" onclick="return( formvalidacion());">
                    <input title="Cancelar [Alt+X]" accesskey="X" class="cancel" type="button" name="button" value="Cancelar" style="width:100px" onclick="window.history.back()">
		</div>
		</td>
            </tr>            
	</tbody>       
       </table>
    </form>
    </div>
   
</div>